package dto

import (
	"github.com/gin-gonic/gin"
	"k8s-dash/utils"
)

type DsNameInput struct {
	Name      string `json:"name" form:"name" comment:"ds名称" validate:"required"`
	Namespace string `json:"namespace" form:"namespace" validate:"required" comment:"命名空间"`
}

type DsUpdateInput struct {
	Content   string `json:"content" form:"content" comment:"内容" validate:"required"`
	Namespace string `json:"namespace" form:"namespace" validate:"required" comment:"命名空间"`
}

type DsListInput struct {
	FilterName string `json:"filter_name" form:"filter_name" validate:"" comment:"过滤名"`
	Namespace  string `json:"namespace" form:"namespace" validate:"" comment:"命名空间"`
	Limit      int    `json:"limit" form:"limit" validate:"" comment:"分页限制"`
	Page       int    `json:"page" form:"page" validate:"" comment:"页码"`
}

func (p *DsListInput) BindValidate(c *gin.Context) error {
	return utils.DefaultParamsValidate(c, p)
}

func (p *DsNameInput) BindValidate(c *gin.Context) error {
	return utils.DefaultParamsValidate(c, p)
}
func (p *DsUpdateInput) BindValidate(c *gin.Context) error {
	return utils.DefaultParamsValidate(c, p)
}
